<template>
  <div class="box1">
    <ul class="box02">
      <div><h2>用户资料</h2></div>
    <div><h3>昵称：{{usernfor.uAlias}}</h3></div>
    <div><h3>手机号：{{usernfor.uPassword}}</h3></div>
      <div><h3>性别：{{usernfor.uSex==1?'男':'女'}}</h3></div>
        <div><h3>邮箱：{{usernfor.uMail}}</h3></div>
          <div><h3>真实姓名：{{usernfor.uName}}</h3></div>
    </ul>
  </div>
</template>

<script>
  import Qs from 'qs';
    export default {
        name: "MyInformation",
        data() {
            return {
          usernfor:{
            uMail:'',
            uPassword:'',
            uSex:0,
            uAlias:'',
            uName:''}


            }
        },
      created() {
        this.getInfor();
        console.log(JSON.parse(sessionStorage.getItem('userinfo')).uTelephone)
      },
      methods:{
        getInfor(){
          var vm = this;
          var uTelephone = JSON.parse(sessionStorage.getItem('userinfo')).uTelephone
          console.log(uTelephone)
           this.axios({
             method:'post',
             url:'http://localhost:80/api/user/see',
             transformRequest: [function (data) {
               return Qs.stringify(data)
             }],
             data:{uTelephone:uTelephone}
           }).then(function (res) {
             if (res.data.success) {
               console.log( res.data.data)
               vm.usernfor = res.data.data;
             }
           })
        }
      }
    }

</script>

<style scoped>
  .box1{
    border:1px solid #DCDFE6;
    box-shadow: 0px 0px 5px #DCDFE6;
    border-radius: 10px;
    width: 800px;
    height: 600px;
    margin-left: 0;
    margin-top: 50px;
  }
  .box02{
    margin-right: 300px;
    margin-top: 150px;
  }



</style>
